package com.haoshuang.zhouzhoubang.widget.camera

import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemMyPictureCameraBinding
import com.luck.picture.lib.config.PictureMimeType
import com.luck.picture.lib.entity.LocalMedia
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.load
import com.mufeng.libs.utils.view.visibleOrGone


/**
 * 
 */
class MyPictureCameraAdapter(data: MutableList<LocalMedia>) : BaseBindingQuickAdapter<LocalMedia, ItemMyPictureCameraBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: LocalMedia?) {
        holder.getViewBinding<ItemMyPictureCameraBinding>().apply {
            rivImage.load(item?.realPath, placeholder = R.mipmap.default_image, error = R.mipmap.default_image)
            ivVideo.visibleOrGone(PictureMimeType.isHasVideo(item?.mimeType))
        }
    }

}